home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 7 / Apprentice-Release7.iso / Source Code / Add-Ons / MicroPhone / Open Mike™ / Open Mike™ 004 / Mike's Folder / Question & Answer < prev    next >
Encoding:
Text File  |  1993-03-31  |  3.3 KB  |  56 lines  |  [TEXT/ttxt]

  1. Question & Answer
  2. =================
  3. Copyright © 1993 by Celestin Company
  4. All rights reserved.
  5.  
  6. No part of this work may be reproduced or transmitted in any form or by any means, electronic or mechanical, including photocopying, recording, or by any information storage and retrieval system, without permission in writing from the publisher. However, you are permitted to make copies of this work, printed or otherwise, as long as said copies are for your personal use only.
  7.  
  8. Introduction
  9. ------------
  10. If you've got a question, simple or complicated, strange or common, send it to us. We'll try to answer as many questions as we have time for. And who knows, maybe your question will be the basis of a future article? Send your questions to any of the electronic addresses listed elsewhere in this issue.
  11.  
  12. Errors in Expressions
  13. ---------------------
  14. Q: I'm trying to debug my scripts and I'm using the "errors in expressions" feature of Trace. Now, almost every line of my scripts comes up with an error, though if I turn off trace, everything is fine. What's going on?
  15.  
  16.  - K. Tyler
  17.    Vancouver, BC
  18.  
  19. A: Your scripts are probably suffering from lots of type mismatch problems. A type mismatch will happen when you try to do something in an expression with two different expression types, such as integers and strings. Also, you'll get a type mismatch error when you try to use integers when MicroPhone expects strings. Example:
  20.  
  21.   Alert OK "Day"
  22.  
  23. The above example will generate a type mismatch, because you are using an integer in the Alert command, which really wants a string. To overcome the mismatch, change the line to read:
  24.  
  25.   Alert OK "String(Day)"
  26.  
  27. This converts Day into a string, which the Alert command can handle properly. Another example of a type mismatch is when you try to concatenate several integers together, like this:
  28.  
  29.   Set Variable combined from Expression "Day & Month"
  30.  
  31. The concatenation feature of MicroPhone really only works with strings, so you need to convert each integer into a string before performing the concatenation:
  32.  
  33.   Set Variable combined from Expression "String(Day) & String(Month)"
  34.  
  35. MicroPhone is very forgiving when you mismatch types, but the "errors in expressions" feature of Trace will automatically flag each type mismatch.
  36.  
  37. Sending ASCII Characters
  38. ------------------------
  39. Q. My system administrator informs me that I need to occasionally send an ASCII 27 character. How do I do this with MicroPhone?
  40.  
  41.  - P. Brunswick
  42.    Queens, NY
  43.  
  44. A. Use the Char function in MicroPhone to send any of the ASCII characters. In order to send ASCII 27 (which is really the Escape key), create the following script:
  45.  
  46.   Send Text String "Char(27)"
  47.  
  48. Quitting MicroPhone
  49. -------------------
  50. Q. Whenever I quit MicroPhone, I get a save changes to settings alert. I know that I changed some communications parameters temporarily, but I don't want to keep seeing this annoying alert. How can I get around it?
  51.  
  52.  - U. Sims
  53.    Seattle, WA
  54.  
  55. A. Create a one-line script that contains a Restore All Params script command. Then, go to the Settings menu and choose Turnkey Actions. Make your one-line script the closing action and save your settings document. Now, whenever you make parameter changes in your document, the document will be restored when you close it, and you won't get the save changes alert.
  56.